package com.cc.service.impl;

import com.cc.entity.Cart;
import com.cc.entity.ChildrenCategory;
import com.cc.entity.ParentCategory;
import com.cc.entity.Produce;
import com.cc.feign.CartFeign;
import com.cc.feign.CategoryFeign;
import com.cc.feign.ProduceFeign;
import com.cc.service.CommodityService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @program:
 * @ClassName:
 * @description:
 * @author: zgc
 * @date:
 * @Version 1.0
 **/
@Service
public class CommodityServiceImpl implements CommodityService {
    @Resource
    private CartFeign cartFeign;
    @Resource
    private ProduceFeign produceFeign;
    @Resource
    private CategoryFeign categoryFeign;

    @Override
    public List<Cart> selectCart(Integer userId) {
        List<Cart> cartList = cartFeign.selectCart(userId);
        return cartList;
    }

    @Override
    public Produce selectProduce(Integer produceId) {
        Produce produce = produceFeign.selectProduce(produceId);
        return produce;
    }

    @Override
    public List<ParentCategory> selectParentCategory(ParentCategory parentCategory) {
        List<ParentCategory> parentCategoryList = categoryFeign.selectParentCategory(parentCategory);
        return parentCategoryList;
    }

    @Override
    public List<ChildrenCategory> selectChildrenCategory(ChildrenCategory childrenCategory) {
        List<ChildrenCategory> childrenCategoryList = categoryFeign.selectChildrenCategory(childrenCategory);
        return childrenCategoryList;
    }

    @Override
    public Integer insertChildrenCategory(ChildrenCategory childrenCategory) {
        int childId = categoryFeign.insertChildrenCategory(childrenCategory);
        return childId;
    }
}
